package com.jml.impl;

import com.jml.api.member.MemberService;
import com.jml.feign.MemberServiceFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


@RestController
public class OrderServiceImpl {
    @Autowired
    private MemberServiceFeign memberServiceFeign;
    @Autowired
    private MemberService memberService;
    @Autowired
    private FeignClientProxy feignClientProxy;

    @RequestMapping("/getOrderToMember")
    public Object getOrderToMember() {
        //使用自定义的feign
        MemberServiceFeign memberServiceFeign = feignClientProxy.create(MemberServiceFeign.class);
        Map<Object, Object> myUser = memberServiceFeign.getUser();
        System.out.println("自定义feign返回结果："+myUser);
        //使用spring的feign
        Map<Object, Object> user = memberServiceFeign.getUser();
        System.out.println("spring feign返回结果："+myUser);
        return user;
    }
}
